package com.synergy.stockflow.sales.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.synergy.stockflow.warehouse.entity.Warehouse;
import io.swagger.v3.oas.annotations.media.Schema;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

@Schema
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "order_returns")
public class OrderReturns {
    /**
     * 退货编码
     */
    @TableId(value = "order_returns_id", type = IdType.ASSIGN_ID)
    @Schema(description="退货编码")
    private String orderReturnsId;

    /**
     * 报价单编码
     */
    @TableField(value = "order_returns_quotation_id")
    @Schema(description="报价单编码")
    private String orderReturnsQuotationId;

    /**
     * 申请退货时间
     */
    @TableField(value = "order_returns_application_timeline")
    @Schema(description="申请退货时间")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date orderReturnsApplicationTimeline;

    /**
     * 退货原因
     */
    @TableField(value = "order_returns_cause")
    @Schema(description="退货原因")
    private String orderReturnsCause;

    /**
     * 退货仓库
     */
    @TableField(value = "order_returns_warehouse")
    @Schema(description="退货仓库")
    private String orderReturnsWarehouse;

    /**
     * 已出库退货数量
     */
    @TableField(value = "order_returns_outbound_quantity")
    @Schema(description="已出库退货数量")
    private BigDecimal orderReturnsOutboundQuantity;

    /**
     * 已出库退货重量
     */
    @TableField(value = "order_returns_outbound_weight")
    @Schema(description="已出库退货重量")
    private BigDecimal orderReturnsOutboundWeight;

    /**
     * 已出库退货总金额
     */
    @TableField(value = "order_returns_the_outbound_amount")
    @Schema(description="已出库退货总金额")
    private BigDecimal orderReturnsTheOutboundAmount;

    /**
     * 退货总数量
     */
    @TableField(value = "order_returns_total_quantity")
    @Schema(description="退货总数量")
    private BigDecimal orderReturnsTotalQuantity;

    /**
     * 退货总重量
     */
    @TableField(value = "order_returns_total_weight")
    @Schema(description="退货总重量")
    private BigDecimal orderReturnsTotalWeight;

    /**
     * 状态
     */
    @TableField(value = "order_returns_state")
    @Schema(description="状态")
    private String orderReturnsState;

    /**
     * 经办人
     */
    @TableField(value = "order_returns_attn")
    @Schema(description="经办人")
    private String orderReturnsAttn;

    /**
     * 发货编码
     */
    @TableField(value = "order_returns_shipment_history_id")
    @Schema(description="发货订单编码")
    private String orderReturnsShipmentHistoryId;

    @TableField(exist = false)
    @Schema(description="员工姓名")
    private String nickname;

    @TableField(exist = false)
    @Schema(description="仓库")
    private Warehouse warehouse;

    @TableField(exist = false)
    @Schema(description="退货详情")
    private List<OrderReturnDetails> orderReturnDetailsList;
}